package io2;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class TestNote {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("fos.txt");

        System.out.println("请输入");
        int a=1;
        while (true){
            Scanner sc=new Scanner(System.in);
            String s=sc.next();
            if(s.equals("exit"))
                break;
            fos.write(s.getBytes(StandardCharsets.UTF_8));
            fos.write(10);
           // a++;
        }
        fos.close();
    }
}
